<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>预约挂号</title>
    <link rel="stylesheet" type="text/css" href="css/swiper.min.css" />
	  <link href="css/choose.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" type="text/css" href="css/aui.css" />
		<link rel="stylesheet" type="text/css" href="css/main.css" />
</head>
<body>

    <div class="site-name">
      <p>北京114预约挂号平台</p>
    </div>

    <div class="submit-title">
      <h4>挂号信息</h4>
    </div>

    <div class="order-item-body">
<!--      <div class="order-item-row">-->
<!--        <span>就诊日期</span>-->
<!--        <p>2020年11月20日</p>-->
<!--      </div>-->
<!--      <div class="order-item-row">-->
<!--        <span>就诊医院</span>-->
<!--        <p>中国人民解放军总医院</p>-->
<!--      </div>-->
<!--      <div class="order-item-row">-->
<!--        <span>挂号科室</span>-->
<!--        <p>风湿科</p>-->
<!--      </div>-->
<!--      <div class="order-item-row">-->
<!--        <span>医生职称</span>-->
<!--        <p>医师</p>-->
<!--      </div>-->
<!--      <div class="order-item-row">-->
<!--        <span>医生专长</span>-->
<!--        <p>风湿科常见病</p>-->
<!--      </div>-->
<!--      <div class="order-item-row">-->
<!--        <span>医事服务费</span>-->
<!--        <p>50元</p>-->
<!--      </div>-->
    </div>

    <div class="add-wrapper">
      <div class="add-title">
        <h4>就诊人信息</h4>
      </div>

      <div class="add-list">
        <div class="add-item">
          <div class="add-left">
            <p>*就诊人手机号</p>
          </div>
          <div class="add-right">
            <div class="add-input">
              <p>13155555555</p>
            </div>
          </div>
        </div>

        <div class="add-item">
          <div class="add-left">
            <p>*短信验证码</p>
          </div>
          <div class="add-right">
            <div class="add-input">
              <input placeholder="请输入短信验证码"/>
              <em>获取验证码</em>
            </div>
          </div>
        </div>

      </div>

      <div class="add-title">
        <h4>联系人信息</h4>
      </div>

      <div class="add-list">
        <div class="add-item">
          <div class="add-left">
            <p>*联系人姓名</p>
          </div>
          <div class="add-right">
            <div class="add-input">
              <input id="name" placeholder="请输入联系人姓名" />
            </div>
          </div>
        </div>

        <div class="add-item">
          <div class="add-left">
            <p>*联系人证件类型</p>
          </div>
          <div class="add-right">
            <div class="add-input sele-bp-3">
              <input id="cardType" placeholder="点击选择联系人证件类型"/>
            </div>
            <div class="display-none">
              <div vid="居民身份证(包含现役军人、人民武装警察)">居民身份证(包含现役军人、人民武装警察)</div>
              <div vid="港澳居民来往内地通行证">港澳居民来往内地通行证</div>
              <div vid="台湾居民来往大陆通行证">台湾居民来往大陆通行证</div>
              <div vid="护照">护照</div>
              <div vid="外国人永久居留身份证">外国人永久居留身份证</div>
              <div vid="港澳居民居住证">港澳居民居住证</div>
              <div vid="台湾居民居住证">台湾居民居住证</div>
            </div>
            <i class="aui-iconfont aui-icon-right"></i>
          </div>
        </div>

        <div class="add-item">
          <div class="add-left">
            <p>*联系人证件号码</p>
          </div>
          <div class="add-right">
            <div class="add-input">
              <input id="cardId" placeholder="请输入联系人证件号码" />
            </div>
          </div>
        </div>

        <div class="add-item">
          <div class="add-left">
            <p>*联系人手机号</p>
          </div>
          <div class="add-right">
            <div class="add-input">
              <input id="phone" placeholder="请输入联系人手机号" />
            </div>
          </div>
        </div>

      </div>

    </div>

    <div class="submit-title">
      <h4>医院预约规则</h4>
    </div>

    <div class="submit-body">
      <p>1、如果您居住或去过辽宁大连等中/高风险地区，请按照北京市防
      疫防控要求，接受新冠排查后再预约就诊，我院对中/高风险地区
      人群进行出入管控。挂号咨询: 010-66939343
      </p>
      <p>2、如果您居住或去过辽宁大连等中/高风险地区，请按照北京市防
      疫防控要求，接受新冠排查后再预约就诊，我院对中/高风险地区
      人群进行出入管控。挂号咨询: 010-66939343
      </p>
      <p>3、如果您居住或去过辽宁大连等中/高风险地区，请按照北京市防
      疫防控要求，接受新冠排查后再预约就诊，我院对中/高风险地区
      人群进行出入管控。挂号咨询: 010-66939343
      </p>
      <p>4、如果您居住或去过辽宁大连等中/高风险地区，请按照北京市防
      疫防控要求，接受新冠排查后再预约就诊，我院对中/高风险地区
      人群进行出入管控。挂号咨询: 010-66939343
      </p>
      <p>5、如果您居住或去过辽宁大连等中/高风险地区，请按照北京市防
      疫防控要求，接受新冠排查后再预约就诊，我院对中/高风险地区
      人群进行出入管控。挂号咨询: 010-66939343
      </p>
      <p>6、如果您居住或去过辽宁大连等中/高风险地区，请按照北京市防
      疫防控要求，接受新冠排查后再预约就诊，我院对中/高风险地区
      人群进行出入管控。挂号咨询: 010-66939343
      </p>

      <div class="login-btn">
        <a class="create.html">确认挂号</a>
      </div>
    </div>

</body>
<script src="js/jquery.min.js"></script>
<script src="js/swiper.min.js"></script>
<script src="js/hSdrop.js"></script>
<script src="js/url.js"></script>
<script src="layer/layer.js"></script>
<script>
  new hSdrop({
    els:'.sele-bp-1'
  })

  new hSdrop({
    els:'.sele-bp-2'
  })

  new hSdrop({
    els:'.sele-bp-3'
  })
  var time = location.href.split("=")[2];
  var id = location.href.split("=")[1].split("&")[0];
  var cardId = sessionStorage.getItem("careId");
  var reg;
  var doc;
  var date = new Date(time);
  $.ajax({
    url: getUrl()+"/wechat114/doctor/getDoctorForReg",
    data:{"id": id},
    dataType:"json",
    type:"get",
    success:function (data) {
      doc = data.data;
      $(".order-item-body").append(`
        <div class="order-item-row">
        <span>就诊日期</span>
        <p>${time}</p>
        </div>
        <div class="order-item-row">
        <span>就诊医院</span>
        <p>${doc.hospitalName}</p>
        </div>
        <div class="order-item-row">
        <span>挂号科室</span>
        <p>${doc.officesName}</p>
        </div>
        <div class="order-item-row">
        <span>医生职称</span>
        <p>${doc.doctorTitle}</p>
        </div>
        <div class="order-item-row">
        <span>医生专长</span>
        <p>${doc.doctorAbility}</p>
        </div>
        <div class="order-item-row">
        <span>医事服务费</span>
        <p>${doc.registeredPrice}元</p>
        </div>
    `);
    }
  })

  $.ajax({
    url: getUrl()+"/wechat114/patient/selectByCardId",
    data:{"cardId": cardId},
    dataType:"json",
    type:"get",
    success:function (data) {
      reg = data.data;
      if (reg!=null){
        $(".add-input p").html(reg.patientPhone);
      }
    }
  });

  $(".login-btn").click(function () {
    $.ajax({
      url: getUrl()+"/wechat114/registration/insertRegistration",
      data:{
        "date": date,
        "doctorId":doc.doctorId,
        "registeredpersonId":reg.patientId,
        "registrationHospital":doc.hospitalName,
        "registrationOffices":doc.officesName,
        "doctorTitle":doc.doctorTitle,
        "doctorAbility":doc.doctorAbility,
        "registeredPrice":doc.registeredPrice
      },
      dataType:"json",
      type:"get",
      success:function (data) {
        if (data.code==0){
          layer.msg(data.msg);
        }else{
          layer.msg(data.msg);
        }
      }
    });
    $.ajax({
      url: getUrl()+"/wechat114/patient/update",
      data:{
        "patientId":reg.patientId,
        "contactName":$("#name").val(),
        "contactIdtype":$("#cardType").val(),
        "contactIdnumber":$("#cardId").val(),
        "contactPhone":$("#phone").val()
      },
      dataType:"json",
      type:"post",
      success:function (data) {
        if (data.code==0){
          layer.msg(data.msg);
        }else{
          layer.msg(data.msg);
        }
      }
    });
  });

</script>
</html>
